<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./iconfont/iconfont.css">
    <link rel="stylesheet" href="./css/03.css">
</head>

<body>
    <header>
        <div class="left">
            <i class="iconfont icon-zuojiantou"></i>
        </div>
    </header>
    <main>
    </main>

    <script src="./http.js"></script>
    <script>
        http.get('http://8.137.157.16:9000/goods/info', { params: { userId: '1', goodsId: '17' } }, function (res) {
            console.log(res);
            console.log(res.data.current_price);

            const goods = `
            <div class="imgs">
            <img src="${res.data.img}" alt="">
        </div>
        <div class="price">
            <span>￥<em>${res.data.current_price}</em><em class="price-pre">￥${res.data.old_price}</em></span>
        </div>
        <div class="discount">
            <div class="photo">
                <span>${res.data.type}</span>
            </div>
            <div class="photo action1">
                <span>${res.data.tags}</span>
            </div>
        </div>
        <div class="huaWei">
            <span>${res.data.title}</span>
        </div>
        <div class="text">
            <span>${res.data.desc_text}</span>
        </div>
            `
            document.querySelector('main').innerHTML = goods
        })
    </script>
</body>

</html>